﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace ERPStore.Web.Start
{
	public class FilterConfig
	{
		public static void RegisterGlobalFilters(GlobalFilterCollection filters)
		{
			var handleError = new Controllers.ActionFilters.ExceptionActionFilter();
			handleError.View = "500";
			filters.Add(handleError);

			if (GlobalConfiguration.Configuration.Settings.PrivateMode)
			{
				var privateFilter = new Controllers.ActionFilters.PrivateActionFilter();
				filters.Add(privateFilter);
			}

			GlobalConfiguration.Configuration.Logger.Info("Global filters registered");
		}
	}
}
